package verifica.plsdatabase;

import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.List;

import torinoflickrdata.db.FlickrUser;

public class KML4FlickrUser {

	public static void print(List<FlickrUser>f, String file) throws Exception{
		
		
		PrintWriter out = new PrintWriter(new FileWriter(file));
		
		 out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
			out.println("<kml>");
			out.println("<Document>");
			
			out.println("<Style id=\"ffffffff\">");
			out.println("<IconStyle>");
			out.println("<scale>1.2</scale>");
			out.println("<Icon>");
			out.println("<href>http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png</href>");
			out.println("</Icon>");
			out.println("</IconStyle>");
			out.println("<LabelStyle>");
			out.println("<color>ffffffff</color>");
			out.println("</LabelStyle>");
			out.println("<ListStyle>");
			out.println("</ListStyle>");
			out.println("</Style>");
	  
			  for (int i = 0; i < f.size(); i++) {
					out.println("<Placemark>");
					out.println("<styleUrl>#ffffffff</styleUrl>");
					out.println("<Point>");
					out.println("<gx:drawOrder>1</gx:drawOrder>");
			       // out.print(" <coordinates>"+f.get(i).lon+","+f.get(i).lat+",0 </coordinates>");
			        out.println("</Point>");
					out.println("</Placemark>");
				}
		 
		         out.println("</Document>");
			     out.println("</kml>");
			     out.close();
	}	
		
	
	
}
